package com.neusoft.common.db;

import org.springframework.jdbc.core.*;

import java.sql.*;

/**
 * 将rs转换为对象
 * Created By YZ at Jun 30, 2010 11:26:52 AM
 * Class:BeanRowMapper
 *
 */
public class BeanRowMapper implements RowMapper{
    private Class type;

    private BeanProcessor convert = new BeanProcessor();

    public BeanRowMapper(Class type){
        this.type = type;
    }

    public Object mapRow(ResultSet rs, int arg1) throws SQLException{
        return convert.toBean(rs, type);
    }
}
